package com.example.ttlproducer.service;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zfj
 * @date 2022/2/21 -22:39
 */

	@Configuration
	public class DeadRabbitMqConfig {
		//1.声明注册fanout模式交换机
		//Direct交换机 起名：TestDirectExchange
		@Bean
		public DirectExchange deaddirectExchange() {
			//  return new DirectExchange("TestDirectExchange",true,true);
			return new DirectExchange("dead_direct_exchange", true, false);
		}

		@Bean
		public Queue deadQueue() {
			return new Queue("dead.direct.queue", true);
		}

	@Bean
	public Binding deadbinds() {
		return BindingBuilder.bind(deadQueue()).to(deaddirectExchange()).with("dead");
	}

	}
